<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <!-- 引入样式 -->
    <!-- <link rel="stylesheet" href="css/element-ui/index.css"> -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

</head>


<body>
    <div id="app">
        <el-table :data="tableData" style="width: 100%">

            <el-table-column prop="logName" label="浏览记录">
            </el-table-column>
            <el-table-column prop="logTime" label="浏览时间">
            </el-table-column>
        </el-table>

    </div>





</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<!-- 引入组件库 -->
<!-- <script src="js/element-ui/index.js"></script> -->
<!-- <script src="js/vue.js"></script> -->

<script>
    new Vue({
        el: '#app',
        data() {
            return {
                authentication: "",
                tableData: []
            }
        },
        created() {
            //获取token字符串
            var url = window.location.href
            var authentication = "authentication="
            idx = url.indexOf(authentication)
            if (idx != -1) {
                this.authentication = url.substring(idx + authentication.length);
            }
            console.log(this.authentication)


            //远程
            axios.get('https://qianicloud.cn/api/log/get', {
                    params: {
                        userName: this.authentication
                    }
                })
                .then(res => {
                    // console.log(res.data.data)
                    // console.log(typeof(res.data.data))
                    this.tableData = res.data.data
                })

            //本地
            // axios.get('http://localhost:9090/collect/get', {
            //         params: {
            //             userName: this.authentication
            //         }
            //     })
            //     .then(res => {
            //         // console.log(res.data.data)
            //         // console.log(typeof(res.data.data))
            //         this.tableData = res.data.data
            //     })


        },

        methods: {

        }

    })
</script>

</html>